<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" href="../static/layui-v2.5.3/layui/css/layui.css">
<script type="text/javascript" src="../static/layui/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../static/layui-v2.5.3/layui/layui.js"></script>
<script type="text/javascript" src="../static/js/custom.js"></script>
<script type="text/javascript" src="../static/js/dataTable.js"></script>
</head>
<body>
<div style="margin:40px 100px 0 20px">
	<form class="layui-form" action="save" method="post"lay-filter="myform" id="myform">
	<input type="hidden" name="id" data-th-value="${model.id}" id="id">
		<div class="layui-form-item">
   		<label class="layui-form-label">角色分配：</label>
   		<div class="layui-input-block">
		   <input type="hidden" name="roles" value="${model.roleCodes}">
			<select name="role" lay-filter="roleIds" id="role">
				<option></option>
				<option data-th-each="role:${roles}" data-th-value="${role.code}" data-th-selected="${#strings.contains(model.roleCodes,role.code)}" data-th-text="${role.name}">用户</option>

			</select>
   		</div>
 	</div>
		<div class="layui-form-item">
			<label class="layui-form-label">用户名</label>
			<div class="layui-input-block">
				<input type="text" name="username" data-th-value="${model.username}"placeholder="请输入用户名" class="layui-input" id="username">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">姓名</label>
			<div class="layui-input-block">
				<input type="text" name="code" data-th-value="${model.name}"placeholder="请输入姓名" class="layui-input" id="name">
			</div>
		</div>
		<!-- <div class="layui-form-item">
			<label class="layui-form-label">性别</label>
			<div class="layui-input-block">
				<input type="text" name="sex" data-th-value="${model.sex}"placeholder="请输入性别" class="layui-input" id="sex">
			</div>
		</div> -->
		<div class="layui-form-item">
			<label class="layui-form-label">性别</label>
			<div class="layui-input-block">
			<select name="sex" id="sex">
				<option th:value="男" th:selected="${model.sex=='男'}">男</option>
				<option th:value="女" th:selected="${model.sex=='女'}">女</option>
			</select>
			</div>
			</div>
		<div class="layui-form-item">
			<label class="layui-form-label">年龄</label>
			<div class="layui-input-block">
				<input type="text" name="age" data-th-value="${model.age}"placeholder="请输入年龄" class="layui-input" id="age">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">电话</label>
			<div class="layui-input-block">
				<input type="text" name="phone" data-th-value="${model.phone}"placeholder="请输入年龄" class="layui-input" id="phone">
			</div>
		</div>
	</form>
</div>
	<script type="text/javascript">
	layui.use('form', function(){  //此段代码必不可少
	    var form = layui.form;
	    form.render();
	});
</script>
</body>
</html>